<?php

use console\db\Migration;

/**
 * 创建排查相关信息表
 * 
 * @author emhome <emhome@163.com>
 * @since 1.0
 */
class m190102_100004_t_survey_log extends Migration {

    /**
     * 调查日志信息表
     * @table `survey_log`
     */
    public function buildTableSurveyLog() {
        return [
            'comment' => '调查日志信息表',
            'columns' => [
                'id' => $this->primaryKey()->comment('员工ID'),
                'survey_id' => $this->integer(11)->unsigned()->notNull()->defaultValue(0)->comment('隐患调查表ID'),
                'user_id' => $this->integer(11)->unsigned()->notNull()->defaultValue(0)->comment('用户ID'),
                'admin_id' => $this->integer(11)->unsigned()->notNull()->defaultValue(0)->comment('管理员ID'),
                'company_id' => $this->integer(11)->unsigned()->notNull()->defaultValue(0)->comment('修改人单位ID'),
                'name' => $this->string(50)->comment('修改人姓名'),
                'mark' => $this->string(255)->comment('修改备注'),
                'status' => $this->tinyint(1)->notNull()->defaultValue(10)->comment('状态'),
                'created_at' => $this->unixTimestamp()->comment('日志时间'),
                'updated_at' => $this->unixTimestamp()->comment('更新时间'),
                'deleted_at' => $this->unixTimestamp()->comment('删除时间'),
            ]
        ];
    }

}
